import React, { Component } from "react";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import { StatisticsCondition, InspectComponent, PatrolComponent, DutyWeekComponent} from "./staticstoword.jsx";


class patrolwordRouter extends Component {
    render() {
        return (
            <Router basename="">
                <Switch>
                    <Route path="/patrol/PatrolComponent" component={PatrolComponent} />
                    <Route path='/' render={(routeProps) => {
                        return (
                            //type=1代表巡更
                            <StatisticsCondition {...routeProps} type={1} />
                        )
                    }}></Route>
                </Switch>
            </Router>
        )

    }
}

class inspectwordRouter extends Component {
    render() {
        return (
            <Router basename="">
                <Switch>
                    <Route path="/inspect/InspectComponent" component={InspectComponent} />
                    <Route path='/' render={(routeProps) => {
                        //routeProps就是路由组件传递的参数
                        return (
                            //在原先路由组件参数的情况，扩展绑定父组件对子组件传递的参数
                            //type=2代表巡检
                            <StatisticsCondition {...routeProps} type={2} />
                        )
                    }}></Route>
                </Switch>
            </Router>
        )

    }
}

class dutyweekwordRouter extends Component {
    render() {
        return (
            <Router basename="">
                <Switch>
                    <Route path="/dutyweek/DutyWeekComponent" component={DutyWeekComponent} />
                    <Route path='/' render={(routeProps) => {
                        return (
                            //type=3代表值周
                            <StatisticsCondition {...routeProps} type={3} />
                        )
                    }}></Route>
                </Switch>
            </Router>
        )

    }
}


export { inspectwordRouter, patrolwordRouter, dutyweekwordRouter};




// class PatrolStatics extends Component {
//     // render() {
//     //     const options = ['巡检', '巡更', '值周'];
//     //     const style1 = {
//     //         marginLeft: 65, fontSize: 36, marginTop: 10
//     //     }
//     //     return (
//     //         <div style={{ width: '100%', height: '100%', backgroundColor: '#E8E8E8' }}>
//     //             <div id="content" className="word">
//     //                 <div className="timeSelect">
//     //                     请选择统计时间范围： <RangePicker picker="week" onChange={this.handleSelectTime} />
//     //                 </div>
//     //                 <div className="timeSelect">
//     //                     请选择打印类型:
//     //                     <Checkbox.Group
//     //                         options={options}
//     //                         style={style1}
//     //                         onChange={this.onChange}>

//     //                     </Checkbox.Group>
//     //                 </div>
//     //                 <div className="timeSelect">
//     //                     <Button type="primary" onClick={this.show} style={{ marginLeft: 210, marginTop: 25, width:100}}>预览报表</Button>
//     //                 </div>

//     //             </div>
//     //         </div>
//     //     )
//     // }
// }

